package cn.itcast.com.day05;

/*
1.定义一个Student类：

   a. 要求包含4个成员变量 String name, int age, boolean isMale, int sno

   b. 分别定义5个构造方法
      分别为无参构造
     初始化name，age，isMale三个成员变量值的3参构造方法
     初始化name 和 sno两个成员变量值的2参构造方法
    初始化name，age，isMale三个成员变量值的3参构造方法
    初始化name，age， isMale，sno这4个成员变量值的4参构造方法

   c. 在定义一个成员方法
      public void print() {
        System.out.println(name + "---" + age + "---" + (isMale ? "男" : "女") + "---" + sno);
     }
 */
public class test1 {
    public static void main(String[] args) {
        Student stu1 = new Student("张三",18,true,1);
        Student stu2 = new Student("李四",25,false,2);
        stu1.print();
        stu2.print();
    }
    static class Student {
        String name;
        int age;
        boolean isMale;
        int sno;

        public Student(String name, int age, boolean isMale) {
            this.name = name;
            this.age = age;
            this.isMale = isMale;
        }

        public Student(String name, int sno) {
            this.name = name;
            this.sno = sno;
        }

        public Student() {
        }

        public Student(String name, int age, boolean isMale, int sno) {
            this.name = name;
            this.age = age;
            this.isMale = isMale;
            this.sno = sno;
        }

        public void print() {
            System.out.println(name + "---" + age + "---" + (isMale ? "男" : "女") + "---" + sno);
        }




    }
}
